home *** CD-ROM | disk | FTP | other *** search
- /* This is a short set of the routines that were required to get the f2c programs to */
- /* link with the libF77 and libI77 libraries Basil P. Duval, 9 Jan 1991 */
-
- #include "stdio.h" /* test program for the xtra routines below */
-
-
- #ifndef THINK_C /* this is just used to ignore the test program */
-
- char *mktemp();
- int access();
- void pause();
- int getpid();
- double erf();
- double erfc();
-
- main ()
- {
- char buf[20],*p1;
- int itemp;
- double dtemp;
- real rtemp=3.14;
- (void) strcpy(buf,"tmp.FXXXXXX");
- p1= mktemp(buf);
- itemp=access("bpdxtras.c",0);
- pause();
- itemp=getpid();
- dtemp=erf(&rtemp);
- double erfc(&rtemp);
- }
-
- #endif /* for testing, the def THINK_C can be reversed */
-
- static int tempcnt=0;
-
- char *mktemp (char *nm)
- /* to replace last 6 X characters with an individual number */
- {
- char *cpnt; /*char pointer for name handling */
-
- tempcnt+=1; /* increment counter to make name unique */
- cpnt=nm+strlen(nm)-6;
-
- sprintf(cpnt,"%i",tempcnt);
- return nm;
- }
-
- int access(char *Name, int dummy)
- /* return 0 if Name exists otherwise 1 */
- {
- FILE *fn;
-
- fn=fopen(Name,"r"); /* open the named file for reading */
- if(fn==NULL) return 1; /* null indicates file did not exist */
- fclose(fn); /* close up the buffer */
- return 0; /* yes the file did exist */
- }
-
- void pause()
- /* routine waits for a character to be input */
- {
- }
-
- int getpid()
- /* routine supposed to get a PID */
- {
- return 0;
- }
-
- double erf(x)
- float *x;
- /* routine does something */
- {
- return (double)*x;
- }
-
- double erfc(x)
- float *x;
- /* routine does something */
- {
- return (double)*x;
- }
-